<template>
	<view class="container">
		<view class="page-content">
			<unicloud-db ref="udb" @load="onLoadData" collection="tian-identity" :where="where" field="content"
				v-slot:default="{data, loading, hasMore,error, options}" :options="options">
				<template v-for="(item,index) in data[0].content" :key="index">
					<view class="sub-title" v-if="item.type=='subTitle'">
						<text>{{item.subTitle[locaLang]}}</text>
					</view>
					<view class="content-text" v-if="item.type=='text'">
						<text>{{item.text[locaLang]}}</text>
					</view>
					
				</template>

			</unicloud-db>
		</view>
		<view class="">
			<ap126-footer style="padding-top: 10px;"></ap126-footer>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				where: "key == 'alliance-introduction'"
			}
		},
		computed: {
			locaLang() {
				return uni.getLocale()
			},
		},
		methods: {
			onLoadData(e) {
				console.log(e);
			}
		}
	}
</script>

<style lang="scss">
	.container {
		max-width: 800px;
		// height: 100vh;
		/* 设置最大宽度 */
		margin: 0 auto;
		/* 居中显示 */
		// padding: 20px;
		/* 添加内边距（可选） */
		background-color: #fff;
	}

	.page-content {
		padding: 10px 0;
		min-height: 70vh;
	}
	
	.sub-title{
		margin: 10px 20px;
		color: #2978f5;
		font-weight: 650;
		font-size: 16px;
	}
	
	.content-text{
		color: #555;
		font-size: 15px;
		margin: 10px 14px;
	}
</style>